package com.hspedu.poly_;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/21
 * @time 20:16
 */
public class Poly01 {
    public static void main(String[] args) {
        Master tom = new Master("tom");
        Dog bob = new Dog("bob");
        Bone bone = new Bone("大棒骨");
        tom.feed(bob,bone);

        Cat cat = new Cat("小花猫");
        Fish fish = new Fish("黄花鱼");
        tom.feed(cat,fish);

        Pig pig = new Pig("小花猪");
        Rice rice = new Rice("米饭");
        tom.feed(pig,rice);

        Animal animal = new Cat("笑话");
        animal.eat();
        Cat cat2 = (Cat) animal;
        cat2.catchMouse();

    }
}
